asterisk-chan-dongle: fix iconv lib detection 540/head
authorSebastian Kemper <[email protected]>
Thu, 11 Jun 2020 17:27:48 +0000 (19:27 +0200)
committerSebastian Kemper <[email protected]>
Thu, 11 Jun 2020 17:27:51 +0000 (19:27 +0200)
A small but important oversight crept into the last asterisk-chan-dongle
update. The iconv library detection was changed to look for iconv()
instead of libiconv().

Reminder: the autoconf macros for finding libraries do _not_ include any
extra headers when testing the compile. So the redefinitions done in
iconv.h provided by any libiconv (stub or regular) aren't visible during
the test the macros execute.

This means that when testing for iconv() the only iconv that can be
detected is the one from libc. Moreover, if the libc doesn't provide
iconv, the check will fail. Below example is with uclibc:

checking for iconv in -liconv... no
configure: error: iconv library missing
Makefile:87: recipe for target '/builder/shared-workdir/build/sdk/build_dir/target-arc_archs_uClibc/asterisk-chan-dongle-asterisk16/asterisk-chan-dongle-2020-05-28-328b2b7d/.configured_a17fb5ef857664f03cd0ce37cc5ea591' failed

So, this changes the patch to look for libiconv(), again.

Also, instead of using AC_CHECK_LIB this uses AC_SEARCH_LIBS, like
upstream does. There apparently was a problem with that in the past, but
now it works fine.

checking for rm... rm
checking for library containing libiconv... -liconv
checking for sqlite3_open in -lsqlite3... yes

Signed-off-by: Sebastian Kemper <[email protected]>
net/asterisk-chan-dongle/Makefile
net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch

index 7e9368da7ebd9896eeed0d2c228bca2aa605fae6..873b678128a7ac6eae265d92a2cae73a405d1429 100644 (file)
@@ -13,7 +13,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/wdoekes/asterisk-chan-dongle.git
 PKG_SOURCE_VERSION:=328b2b7ded3b3c59c2e6c7e7afca6b0ac6f146ce
 PKG_SOURCE_DATE=2020-05-28
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MIRROR_HASH:=b0af444840340722ecee111a7b1f819de441acf290799ae11bc18e16569c6388
 
 PKG_FIXUP:=autoreconf
index f72d8d27b273640914285c89652503d115414505..be7d93354290967ee7a9ba35c97a64ea14020a3b 100644 (file)
@@ -5,7 +5,7 @@
  dnl Checks for libraries.
  dnl AC_CHECK_LIB([pthread], [pthread_create])  # should use ast_pthread_join everywhere?
 -AC_SEARCH_LIBS([iconv], [c iconv],,AC_MSG_ERROR([iconv library missing]))
-+AC_CHECK_LIB([iconv], [iconv],,AC_MSG_ERROR([iconv library missing]))
++AC_SEARCH_LIBS([libiconv], [iconv],,AC_MSG_ERROR([iconv library missing]))
  AC_CHECK_LIB([sqlite3], [sqlite3_open],,AC_MSG_ERROR([sqlite3 library missing]))
  
  dnl Checks for header files.